/**
 * Created by www.www.www on 2016/12/16.
 */
    //全选
    var inputs=document.getElementsByTagName('input');
    var allcheck=document.getElementsByClassName('allcheck');
    allcheck[0].onclick=function () {
        for (var i=0;i<inputs.length;i++){
            var input=inputs[i];
            if(input.type=='checkbox'){
                input.checked=allcheck[0].checked;
            }
        }
}
        //数量加减

        $('.jia').on('click',function(){
            var changeNum = $(this).parent('.p-gouwu');
            console.log(changeNum);
            var count = changeNum.find('.inp');
            console.log(count);
            var val = count.val();
            count.val(parseInt(val) + 1);
        })

        $('.jian').on('click', function () {
            var changeNum = $(this).parent('.p-gouwu');
            var count = changeNum.find('.inp');
            var val = count.val();
            if (val == 0) {
                $(this).addClass('disabled')
                return;
            }
            count.val(val - 1);
        });

